﻿using ClassLibrary1;

namespace WebApplication1
{
    public class TestRabbitMqHostedService : IHostedService
    {
        private readonly IServiceProvider _serviceProvider;
        public TestRabbitMqHostedService(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }

        public Task StartAsync(CancellationToken cancellationToken)
        {
            RabbitMqConsumerRegister.Register(_serviceProvider);
            return Task.CompletedTask;
        }

        public Task StopAsync(CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }
    }
}
